import Vue from 'vue'
import VueRouter from 'vue-router'

import index from"../views/index.vue";

import login from "../views/Login/login";
import regester from "../views/Login/regester";

import UserList from "../views/systemManager/UeserManagement/userList";
import addUser from "../views/systemManager/UeserManagement/addUser";
import UserUpdate from "../views/systemManager/UeserManagement/userUpdate";

import FactoryList from "../views/systemManager/FactoryManagement/factoryList";
import FactoryUpdeta from "../views/systemManager/FactoryManagement/factoryUpdeta";

import EquipmentList from "../views/systemManager/EquipmentManagement/EquipmentList";
import addEquipment from "../views/systemManager/EquipmentManagement/addEquipment";
import EquipmentUpdate from "../views/systemManager/EquipmentManagement/EquipmentUpdate";
import EquipmentType from "../views/systemManager/EquipmentManagement/EquipmentType";

import addEquipmentType from "../views/systemManager/EquipmentManagement/addEquipmentType";
import Equipmenttypeupdate from "../views/systemManager/EquipmentManagement/Equipmenttypeupdate";
import showCapactity from "../views/systemManager/EquipmentManagement/showCapactity";

import addProduct from "../views/systemManager/ProductManagement/addProduct";
import ProductList from "../views/systemManager/ProductManagement/productList";
import addProducttype from "../views/systemManager/ProductManagement/addProducttype";
import Producttype from "../views/systemManager/ProductManagement/producttype";
import productUpdate from "../views/systemManager/ProductManagement/productUpdate";
import producttypeUpdate from "../views/systemManager/ProductManagement/producttypeUpdate";

import OrderList from "../views/systemManager/OrderManagement/orderList";

import dealerOrderList from "../views/dealer/dealerOrderList";
import addOrder from "../views/dealer/addOrder";
import orderUpdate from "../views/dealer/orderUpdate";
import selectTender from "../views/dealer/selectTender";

import myFactory from "../views/factoryManager/myFactory";
import managerEquipmentList from "../views/factoryManager/factoryEquipmentList";
import CapactitySetting from "../views/factoryManager/CapactitySetting";
import addFactoryEquipment from "../views/factoryManager/addFactoryEquipment";
import scheduling from "../views/factoryManager/scheduling";
import factoryOrderList from "../views/factoryManager/factoryOrderList";
import borrowEquipment from "../views/factoryManager/borrowEquipment";
Vue.use(VueRouter)

const routes = [
    {
      path:"/",
      name:"登录",
      show:[4],
      right:null,
      component:login,
      meta: {
        requireAuth: false
      }
    },{
      path:"/regester",
      name:"注册",
      show:[4],
      right:null,
      component:regester,
      meta: {
        requireAuth: false
      }
    },{
    path:"/index",
    name:"用户管理",
    show:[3],
    right:null,
    component:index,
    meta: {
      requireAuth: true
    },
    children:[
      {
        path:"/userList",
        name:"用户列表",
        right:null,
        component:UserList,
        show:[3],
        meta: {
          requireAuth: true
        }
      },{
        path:"/addUser",
        name:"添加用户",
        right:null,
        component:addUser,
        show:[3],
        meta: {
          requireAuth: true
        }
      }
    ]
  },{
  path:"/index",
    name:"工厂管理",
    show:[1,3],
    right:null,
    component: index,
    meta: {
      requireAuth: true
    },
    children: [
      {
        path:"/factoryList",
        name:"工厂列表",
        right:null,
        component:FactoryList,
        show:[3],
        meta: {
          requireAuth: true
        }
      },
      {
        path: "/myfactory",
        name:"我的工厂",
        right:null,
        component: myFactory,
        show:[1],
        meta: {
          requireAuth: true
        }
      }
    ]
  },{
    path:"/index",
    name:"产能中心",
    show:[1,3],
    right:null,
    component: index,
    meta: {
      requireAuth: true
    },
    children: [
      {
        path:"/equipmentList",
        name:"设备列表",
        right:null,
        component:EquipmentList,
        show:[3],
        meta: {
          requireAuth: true
        }
      },{
        path:"/addEquipment",
        name:"添加设备",
        right:null,
        component:addEquipment,
        show:[3],
        meta: {
          requireAuth: true
        }
      },{
        path:"/EquipmentType",
        name:"设备类型",
        right:null,
        component:EquipmentType,
        show:[3],
        meta: {
          requireAuth: true
        }
      },{
        path:"/addEquipmentType",
        name:"添加类型",
        right:null,
        component:addEquipmentType,
        show:[3],
        meta: {
          requireAuth: true
        }
      },
      {
        path:"/managerequipmentlist",
        name:"工厂设备",
        right:null,
        component: managerEquipmentList,
        show:[1],
        meta: {
          requireAuth: true
        }
      },{
        path:"/addfactoryequipment",
        name:"新增设备",
        right:null,
        component: addFactoryEquipment,
        show:[1],
        meta: {
          requireAuth: true
        }
      },{
        path:"/borrowEquipment",
        name:"租用设备",
        right:null,
        component: borrowEquipment,
        show:[1],
        meta: {
          requireAuth: true
        }
      }
    ]
  },
  {
    path:"/index",
    name:"产品管理",
    show:[3],
    right:null,
    component: index,
    meta: {
      requireAuth: true
    },
    children: [
      {
        path:"/productList",
        name:"产品列表",
        right:null,component:ProductList,
        show:[3],
        meta: {
          requireAuth: true
        }
      },{
        path:"/addProduct",
        name:"添加产品",
        right:null,
        component:addProduct,
        show:[3],
        meta: {
          requireAuth: true
        }
      },{
        path:"/producttype",
        name:"产品类型",
        right:null,
        component:Producttype,
        show:[3],
        meta: {
          requireAuth: true
        }
      },{
        path:"/addProducttype",
        name:"添加产品类型",
        right:null,
        component:addProducttype,
        show:[3],
        meta: {
          requireAuth: true
        }
      }
    ]
  },
  {
    path:"/index",
    name:"订单管理",
    show:[1,2,3],
    right:null,
    component: index,
    meta: {
      requireAuth: true
    },
    children: [
      {
        path:"/orderList",
        name:"订单列表",
        right:null,
        component:OrderList,
        show:[3],
        meta: {
          requireAuth: true
        }
      },{
        path: "/dealerorderlist",
        name:"我的订单",
        show:[2],
        right:null,
        component: dealerOrderList,
        meta: {
          requireAuth: true
        },
      },{
        path:"/addorder",
        name: "新建订单",
        right:null,
        component: addOrder,
        show:[2],
        meta: {
          requireAuth: true
        },
      },{
        path:"/factoryOrderList",
        name: "查看订单",
        right:null,
        component: factoryOrderList,
        show:[1],
        meta: {
          requireAuth: true
        },
      },
      //以下页面只能通过跳转得到
      {
        path: "/userupdate",
        name:"用户更新",
        right:null,
        component: UserUpdate,
        show:[4],
        meta: {
          requireAuth: true
        }
      },
      {
        path: "/factoryupdate",
        name:"工厂更新",
        right:null,
        component: FactoryUpdeta,
        show:[4],
        meta: {
          requireAuth: true
        }
      },
      {
        path: "/equipmentupdate",
        name:"设备更新",
        right:null,
        component: EquipmentUpdate,
        show:[4],
        meta: {
          requireAuth: true
        }
      },
      {
        path: "/equipmenttypeupdate",
        name:"设备类型更新",
        right:null,
        component: Equipmenttypeupdate,
        show:[4],
        meta: {
          requireAuth: true
        }
      },
      {
        path: "/productupdate",
        name:"产品更新",
        right:null,
        component: productUpdate,
        show:[4],
        meta: {
          requireAuth: true
        }
      },
      {
        path: "/producttypeupdate",
        name:"产品类型更新",
        right:null,
        component: producttypeUpdate,
        show:[4],
        meta: {
          requireAuth: true
        }
      },
      {
        path:"/orderupdate",
        name:"订单更新",
        right:null,
        component: orderUpdate,
        show:[4],
        meta: {
          requireAuth: true
        }
      },
      {
        path: "/selecttender",
        name:"选标",
        right:null,
        component: selectTender,
        show:[4],
        meta: {
          requireAuth: true
        }
      },
      {
        path: "/capactitysetting",
        name: "产能配置",
        right:null,
        component: CapactitySetting,
        show:[4],
        meta: {
          requireAuth: true
        }
      },{
        path: "/scheduling",
        name:"设备排产",
        right:null,
        component: scheduling,
        show:[4],
        meta: {
          requireAuth: true
        }
      },{
        path: "/showCapactity",
        name:"设备排产",
        right:null,
        component: showCapactity,
        show:[4],
        meta: {
          requireAuth: true
        }
      }
    ]
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
